package com.invite.me.ui.yqm;

import android.content.Intent;
import android.text.TextUtils;

import com.invite.me.R;
import com.invite.me.base.BaseActivity;
import com.invite.me.ui.home.HomeActivity;
import com.invite.me.ui.registeractivity.RegisterNumberActivity;
import com.invite.me.util.SspPrefUtils;
import com.invite.me.wlqq.Constants;

public class SplashActivity extends BaseActivity {


    @Override
    protected void initView() {

//        StatusBarUtil.statusBarDarkMode(this);
    }

    @Override
    protected int getActivityLayoutId() {
        return R.layout.activity_splash;
    }

    @Override
    protected void loadData() {
        new Thread() {
            @Override
            public void run() {
                super.run();
                try {
                    Thread.sleep(2000);//休眠3秒
                } catch (InterruptedException e) {

                }
                //  SspPrefUtils.setString(Constants.SSPTOKEN,"6ac2486a1bcbb7197609b96798857ac3");
                String string = SspPrefUtils.getString(Constants.SSPTOKEN, "");
                if (!TextUtils.isEmpty(string) && !string.equals("")) {
                    Intent pwr = new Intent(SplashActivity.this, HomeActivity.class);
                    startActivity(pwr);

                } else {
                    Intent pwr = new Intent(SplashActivity.this, RegisterNumberActivity.class);
                    startActivity(pwr);
                }

                finish();
            }
        }.start();

    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
    }
}